export function debounce(func, delay) {
  let timer = null;

  return function (...argument) {
    if (timer) clearTimeout(timer);
    timer = setTimeout(() => {
      func.apply(this,argument);
    }, delay);
    
  };
}